package org.study.springboot.websocket.controller;

import cn.hutool.core.lang.Dict;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.study.springboot.websocket.model.Server;
import org.study.springboot.websocket.payload.ServerVO;
import org.study.springboot.websocket.util.ServerUtil;

/**
 * @author fangyu
 * @version v1.0.0
 * @date 2020/11/18 5:28 下午
 */
@RestController
@RequestMapping(value = "/server")
public class ServerController {

    @GetMapping
    public Dict serverInfo() throws Exception{
        Server server = new Server();
        server.copyTo();
        ServerVO serverVO = ServerUtil.wrapServerVO(server);
        return ServerUtil.wrapServerDict(serverVO);
    }
}
